(()=>{"use strict";function n(){try{return window.self!==window.top}catch(e){return 1}}function m(e){if(e)return e;e=document.location.href;return e=n()?document.referrer:e}function i(t){const n={};if(!t)return n;try{const e=new URL(t);return e.searchParams.forEach((e,t)=>{n[t]=e}),n}catch(e){return console.log("full url missing: ",t),n}}function u(e){var t=i(m());return e in t?t[e]:""}function p(){return u("utm_campaign")||u("campaign")}function h(e){var t=u("rf");if(t&&"string"==typeof t&&"false"==t)return"";if(e)return e;e=u("hl_referrer");return e||(n()||!document.referrer||document.referrer.includes(document.location.origin)?"":document.referrer)}function s(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),1}catch(e){return}}function _(e){if(s("localStorage"))return localStorage.getItem(e)}function v(e,t){s("localStorage")&&localStorage.setItem(e,t)}function w(e){s("localStorage")&&localStorage.removeItem(e)}function y(e){var t=function(e){if(s("localStorage")){var t=localStorage.getItem(e);if(!t)return null;t=JSON.parse(t);const n=new Date;return n.getTime()>t.expiry?(localStorage.removeItem(e),null):t.value}}(e);if(t)return t;e=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return e&&e[2]?e[2]:""}function o(e,t,n){if(s("localStorage")){const i=new Date;n={value:t,expiry:i.getTime()+n};localStorage.setItem(e,JSON.stringify(n))}}function l(e,n,i){if(s("localStorage"))o(e,n,i?24*i*60*60*1e3:31536e6);else{let t="";if(i){let e=new Date;e.setTime(e.getTime()+24*i*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=e+"="+(n||"")+t+"; path=/"}}function I(t,n,i){if(s("localStorage"))o(t,n,60*(i=i||1)*1e3);else{let e="";if(i){const r=new Date;r.setTime(r.getTime()+60*i*1e3),e="; expires="+r.toUTCString()}document.cookie=t+"="+(n||"")+e+"; path=/"}}const t="v2_history",r="v2_contact_session_";function b(e){return(e=e||y("location_id"))?`${t}_${e}`:t}function S(e){return(e=e||y("location_id"))?`${r}${e}_session_id`:`${r}id`}function k(e){return`v2_session_history_${e=e||y("location_id")}`}function a(e){return`v2_user_session_event_${e=e||y("location_id")}_fingerprint`}async function T(e,t){try{return await(await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}catch(e){return{}}}function N(e){if(!e)return null;try{return JSON.parse(e)}catch(e){return console.log(e),null}}class e{constructor(e,t){this.baseUrl=function(){const e=document.getElementsByTagName("script");for(var t=0;te.page.url==m(s)),g=null;if((g=0{a&&l(S(e),a,365),await this.store(e,t,n,i,r,s)},c)}update(e){var t=e.sessionId||"",e=e.locationId||"";this.locationId=e,t&&(I(S(e),t,30),w(k(e)))}getCookie(e){return y(e)}setCookies(e,t){e&&t&&l(e,t)}getSessionId(e){return y(S(e||this.locationId))}getUserFingerprint(e){return y(a(e||this.locationId))}setUserFingerprint(e,t){return l(a(e||this.locationId),t)}}var c="undefined"==typeof window?{}:window;c.userSessionAttribution||(c.userSessionAttribution=new e)})();